package com.zy.ems.common.enums;

/**
 * 配送时间。
 * 
 * @author Luffy
 *
 */
public enum DeliveryTime {
    //
    workday(1, "只工作日送货（双休日、假日不用送）", false),
    //
    dayoff(2, "只双休日、假日送货（工作日不用送）", false),
    //
    evenday(3, "工作日、双休日与假日均可送货", false);

    private int code;

    private String text;

    private boolean disable;

    private DeliveryTime(int code, String text, boolean disable) {
        this.code = code;
        this.text = text;
        this.disable = disable;
    }

    public static DeliveryTime[] getAllInfo() {
        return values();
    }

    public static DeliveryTime valueOf(int code) {
        for (DeliveryTime dt : values()) {
            if (code == dt.getCode()) {
                return dt;
            }
        }
        return DeliveryTime.evenday;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public boolean isDisable() {
        return disable;
    }

}
